package day14.pack4;

import java.util.ArrayList;
import java.util.List;

public class SinaWeibo extends Weibo {
    private List<Fan> list = new ArrayList<>();
    @Override
    public void notifyFan(String content) {
        for (Fan fan : list) {
            fan.getWeiboMessage(content);
        }
    }

    @Override
    public void addFan(Fan fan) {
        list.add(fan);
    }

    @Override
    public void removeFan(Fan fan) {
        list.remove(fan);
    }

    @Override
    public void sendMessage(String message) {
        System.out.println("微博刚发送一条:" + message);
        notifyFan("您关注微博刚发送了一条" + message);
    }
}
